package com.itboye.sunsunhome.volley;

import java.io.IOException;

import com.google.gson.FieldNamingPolicy;
import com.google.gson.GsonBuilder;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;
import com.itboye.sunsunhome.bean.MessagExtraBean;

/**
 * @author Young
 *
 */

public class MessageExtra extends TypeAdapter<MessagExtraBean>{

	
	@Override
	public MessagExtraBean read(JsonReader in) throws IOException {
		if (in.peek() == JsonToken.NULL) { 
			in.nextNull();
			return null;
		}
		String json=in.nextString();
		return new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create().fromJson(json, MessagExtraBean.class);
	}

 

	@Override
	public void write(JsonWriter arg0, MessagExtraBean arg1) throws IOException {
		// TODO Auto-generated method stub
		
	}

	
}
